package com.efrei.schoolmanager.views.components;

import java.awt.Font;

import javax.swing.JLabel;

public class CustomLabel extends JLabel {
	private static final long serialVersionUID = 6586735715219986070L;
	private final static int TAILLE_FONT = 15;
	private final static int STYLE_FONT = Font.ITALIC;
	private final static String POLICE = "Arial";
	private final static Font FONT = new Font(POLICE, STYLE_FONT, TAILLE_FONT);

	public CustomLabel() {
		super();
		setFont(FONT);
	}

	public CustomLabel(String texte) {
		super(texte);
		setFont(FONT);
	}

	/**
	 * Reduit la taille de la police du label
	 * 
	 * @param taille
	 */
	public void reduirePolice(int taille) {
		if (taille < TAILLE_FONT) {
			setFont(new Font(POLICE, STYLE_FONT, TAILLE_FONT - taille));
		}
	}
}
